const babelCore = require('@babel/core')

const code = `
  var o = { a, b, c };
  
  var cat = {
      getName() {
          return name;
      },
  };
`
const result = babelCore.transformSync(code, {
  plugins: ["@babel/plugin-transform-shorthand-properties"]
})

console.log(result.code);